import Vue from 'vue'
import Router from 'vue-router'


const Home = () => import('@/views/home/home')
const Category = () => import('@/views/category/category')
const Shopcart = () => import('@/views/shopcart/shopcart')
const Profile = () => import('@/views/profile/profile')
const Detail = () => import('@/views/detail/detail')


//1.安装插件
Vue.use(Router)

//2.创建路由对象

const router = new Router({
 //mode: 'history',
  routes:[
    {
        path:'',
        redirect:'/home'
    },
    {
        path:'/home',
        component: Home
    },
    {
        path:'/category',
        component: Category
    },
    {
        path:'/shopcart',
        component: Shopcart
    },
    {
        path:'/profile',
        component: Profile
    },
    {
        path:'/detail:iid',
        component: Detail
    }
    
]

})
export default router
